package com.dsx.myblog.util;

import java.io.*;
import java.util.List;
import java.util.StringJoiner;
import java.util.stream.Collectors;

public class FileReadUtil {

    public static String readAll(String path) throws FileNotFoundException {
        File file= new File(path);
        BufferedReader reader = new BufferedReader(new FileReader(path));
        List<String> list = reader.lines().collect(Collectors.toList());
        StringJoiner sj = new StringJoiner("\n");
        for(String str : list){
            sj.add(str);
        }
        return sj.toString();
    }

}
